bpf: Do not allocate percpu memory at init stage#662
Open
danielocfb wants to merge 1 commit intobpf-next_basefrom
Open
bpf: Do not allocate percpu memory at init stage#662danielocfb wants to merge 1 commit intobpf-next_basefrom
danielocfb wants to merge 1 commit intobpf-next_basefrom
Conversation
Owner
Author
|
Upstream branch: 155addf |
08949e6 to
3a8c9bf
Compare
Owner
Author
|
Upstream branch: 689b097 |
df28bab to
0b9bc9d
Compare
3a8c9bf to
32f9f95
Compare
Owner
Author
|
Upstream branch: 9241176 |
Kirill Shutemov reported significant percpu memory increase after booting in 288-cpu VM ([1]) due to commit 41a5db8 ("bpf: Add support for non-fix-size percpu mem allocation"). The percpu memory is increased from 111MB to 969MB. The number is from /proc/meminfo. I tried to reproduce the issue with my local VM which at most supports upto 255 cpus. With 252 cpus, without the above commit, the percpu memory immediately after boot is 57MB while with the above commit the percpu memory is 231MB. This is not good since so far percpu memory from bpf memory allocator is not widely used yet. Let us change pre-allocation in init stage to on-demand allocation when verifier detects there is a need of percpu memory for bpf program. With this change, percpu memory consumption after boot can be reduced signicantly. [1] https://lore.kernel.org/lkml/20231109154934.4saimljtqx625l3v@box.shutemov.name/ Fixes: 41a5db8 ("bpf: Add support for non-fix-size percpu mem allocation") Cc: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
0b9bc9d to
8cc180b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: bpf: Do not allocate percpu memory at init stage
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=800124